#include <stdio.h>  
int a[105];  
  
int main() {  
    int n, cnt, num, x = 1, y = 0;  
    if (scanf("%d%d", &n, &num));  
    cnt = n;  
    for (int i = 1; i <= n; i++)  
        a[i] = 1;  
    while (cnt != 1) {  
        y++;  
        if (y > n)  
            y = 1;  
        while (a[y] == 0) {  
            y++;  
            if (y > n)  
                y = 1;  
        }  
        if (x == num) {  
            cnt--;  
            a[y] = 0;  
        }  
        x++;  
        if (x > num)  
            x = 1;  
    }  
    for (int i = 1; i <= n; i++)  
        if (a[i] == 1)  
            printf("The left child is NO %d.\n", i);  
    return 0;  
}  